home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume2 / libraris / gimme.7 < prev    next >
Text File  |  1988-12-02  |  39KB  |  1,192 lines

  1. Path: xanth!mcnc!gatech!bloom-beacon!mit-eddie!ll-xn!adelie!infinet!ulowell!page
  2. From: page@swan.ulowell.edu (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v02i080:  gimme.lib - misc library routines, Part07/07
  5. Message-ID: <10418@swan.ulowell.edu>
  6. Date: 2 Dec 88 01:05:06 GMT
  7. Organization: University of Lowell, Computer Science Dept.
  8. Lines: 1181
  9. Approved: page@swan.ulowell.edu
  10.  
  11. Submitted-by: oscvax!jan@uunet.UU.NET (Jan Sven Trabandt)
  12. Posting-number: Volume 2, Issue 80
  13. Archive-name: libraries/gimme.7
  14.  
  15. #    This is a shell archive.
  16. #    Remove everything above and including the cut line.
  17. #    Then run the rest of the file through sh.
  18. #----cut here-----cut here-----cut here-----cut here----#
  19. #!/bin/sh
  20. # shar:    Shell Archiver
  21. #    Run the following text with /bin/sh to create:
  22. #    bitplane.h
  23. #    color.h
  24. #    communic.h
  25. #    copystuff.h
  26. #    debug.h
  27. #    gadget.h
  28. #    gimNOshortdefs.h
  29. #    gimmeall.h
  30. #    gimmefuncs.h
  31. #    gimshortdefs.h
  32. #    globals.h
  33. #    graph.h
  34. #    intuistuff.h
  35. #    macros.h
  36. #    menustuff.h
  37. #    minterm.h
  38. #    picture.h
  39. #    postext.h
  40. #    requester.h
  41. #    scrollbar.h
  42. #    sound.h
  43. #    stdstuff.h
  44. #    window.h
  45. # This archive created: Thu Dec  1 19:30:07 1988
  46. cat << \SHAR_EOF > bitplane.h
  47. #ifndef GIMMELIB_BITPLANE_H
  48. #define GIMMELIB_BITPLANE_H
  49.  
  50. /* flags for gimmeBitPlanes() */
  51. #define GBP_SEPARATE        (1L << 0)       /* separate bitplanes */
  52. #define GBP_CONTIGUOUS        (1L << 1)       /* make bitplanes contiguous */
  53. /* default (can be 0L too): try contiguous first, then separate */
  54. #define GBP_DEFAULT        (GPIC_CONTIGUOUS | GPIC_SEPARATE)
  55. /* error return flag */
  56. #define GBP_ERROR        0xFF000000L    /* unable to get planes */
  57.  
  58. #endif !GIMMELIB_BITPLANE_H
  59. SHAR_EOF
  60. cat << \SHAR_EOF > color.h
  61. #ifndef GIMMELIB_COLOR_H
  62. #define GIMMELIB_COLOR_H
  63.  
  64. #define DFLT_MAX_COLORS    16
  65.  
  66. #ifdef I_AM_COLOR
  67. static USHORT gimColorTable[DFLT_MAX_COLORS] = {
  68.     0x002, 0xaaa, 0x900, 0x039,
  69.     0x2c2, 0xbb0, 0x0ff, 0xf0f,
  70.     0x620, 0xe50, 0x9f1, 0xeb0,
  71.     0x92f, 0x55f, 0x0f8, 0xeee
  72.   };
  73. #endif I_AM_COLOR
  74.  
  75. #define GIM_BACKGROUND    0
  76.  
  77. #define GIM_BLACK    0
  78. #define GIM_WHITE    1
  79. #define GIM_RED     2
  80. #define GIM_BLUE    3
  81.  
  82. #define GIM_GREEN    4
  83. #define GIM_YELLOW    5
  84. #define GIM_CYAN    6
  85. #define GIM_MAGENTA    7
  86.  
  87. #define GIM_DRED    8
  88. #define GIM_ORANGE    9
  89. #define GIM_LGREEN    10
  90. #define GIM_MUSTARD    11
  91. #define GIM_PURPLE    12
  92. #define GIM_LBLUE    13
  93. #define GIM_MINT    14
  94. #define GIM_LWHITE    15
  95.  
  96. #endif !GIMMELIB_COLOR_H
  97. SHAR_EOF
  98. cat << \SHAR_EOF > communic.h
  99. #ifndef GIMMELIB_COMMUNIC_H
  100. #define GIMMELIB_COMMUNIC_H
  101.  
  102.  
  103. #ifdef I_AM_COMMUNIC
  104. /* internal constants */
  105. #ifndef MILLION
  106. #define MILLION     1000000L
  107. #endif
  108. #define SMALL_SECS    0L        /* "small" time-out */
  109. #define SMALL_MICROS    (MILLION / 2)
  110. #define BIG_SECS    2L        /* "large" time-out */
  111. #define BIG_MICROS    0L
  112.  
  113. #define DEFAULT_EOL    0x0d        /* CR */
  114. #endif I_AM_COMMUNIC
  115.  
  116.  
  117. /* Constants used for setup parameters */
  118. #define C_SER_7     1    /* 7 wire handshaking */
  119. #define C_SER_3     2    /* 3 wire XON/XOFF handshaking */
  120.  
  121. #define C_NO_PARITY    1    /* No parity */
  122. #define C_EVEN_PARITY    2    /* Even parity */
  123. #define C_ODD_PARITY    3    /* Odd parity */
  124.  
  125. /* Setup parameter structure */
  126. typedef struct c_parameters {
  127.     WORD C_MODE;        /* Mode of communications to be used */
  128.     WORD C_BAUD;
  129.     WORD C_STOP;
  130.     WORD C_PARITY;
  131.     WORD C_RLEN;
  132.     WORD C_WLEN;
  133. } SERPARMS;
  134.  
  135. /* Error Condition values */
  136. #define C_ERR_OK    0    /* No error occured */
  137. #define C_ERR_INITIAL    1    /* System not initialized */
  138. #define C_ERR_OPEN    2    /* Channel already opened */
  139. #define C_ERR_CANT    3    /* Can't open channel */
  140. #define C_ERR_PARAMS    4    /* Can't set parameters as specified */
  141. #define C_ERR_CHAN    5    /* Channel not open */
  142. #define C_ERR_GET    6    /* Timeout before character recieved */
  143. #define C_ERR_PUT    7    /* Can't send character */
  144. #define C_ERR_PARITY    8    /* Parity specified is not valid */
  145. #define C_ERR_ILLEGAL    9    /* Illegal length parameter for get/put s */
  146. #define C_ERR_BADPARM    10    /* Invalid parameter given to routine */
  147.  
  148. #ifndef I_AM_COMMUNIC
  149. extern short c_error;        /* error number of last communic routine */
  150. #endif !I_AM_COMMUNIC
  151.  
  152. #endif !GIMMELIB_COMMUNIC_H
  153. SHAR_EOF
  154. cat << \SHAR_EOF > copystuff.h
  155. #ifndef GIMMELIB_COPYSTUFF_H
  156. #define GIMMELIB_COPYSTUFF_H
  157.  
  158. /* flags for various copy routines */
  159. #define GCP_NOT_ITEXT    (1L << 1)       /* don't copy IntuiText struct(s) */
  160. #define GCP_NOT_IMAGE    (1L << 2)       /* don't copy Image struct(s) */
  161. #define GCP_NOT_STRING    (1L << 8)       /* don't copy actual string */
  162. #define GCP_NOT_BYTES    (1L << 9)       /* don't copy (image) byte data */
  163. #define GCP_NOT_POINTS    (1L << 10)      /* don't copy (border) points data */
  164. #define GCP_NOT_TEXTATTR  (1L << 11)    /* don't copy (itext) textattr */
  165.  
  166. #define GCP_NOT_STRUCTS (0x000ffL)      /* don't copy "sub-structures" */
  167. #define GCP_NOT_DATA    (0x0ff00L)      /* don't copy "low-level" data */
  168.  
  169. #define GCP_SALVAGE    (1L << 16)      /* try to copy as much as possible */
  170. #define GCP_DEFAULT    (0L)            /* copy everything */
  171.  
  172.  
  173. #endif !GIMMELIB_COPYSTUFF_H
  174. SHAR_EOF
  175. cat << \SHAR_EOF > debug.h
  176. #ifndef GIMMELIB_DEBUG_H
  177. #define GIMMELIB_DEBUG_H
  178.  
  179. #ifdef DEBUG
  180.  
  181. #define DEBUGCMD(c) c
  182. #define DEBUGMSG(c) printf(c)
  183. #define DEBUGMSG1(c,p) printf(c,p)
  184. #define DEBUGMSG2(c,p1,p2) printf(c,p1,p2)
  185. #define DEBUGMSG3(c,p1,p2,p3) printf(c,p1,p2,p3)
  186. #define DEBUGMSG4(c,p1,p2,p3,p4) printf(c,p1,p2,p3,p4)
  187.  
  188. #ifndef OWNDEBUG
  189. /* doPrintf parms: process-port, reply-port, c, p1, p2, p3, p4
  190.  * note regarding reply-port: if it is NULL, then the printf might not get
  191.  * done before a crash since doPrintf will not wait for a reply to make
  192.  * sure that the printf was done
  193.  * THIS VERSION uses gimMainPort as a default port, so it had better be there!!
  194. */
  195. /* subtask debug message */
  196. #define STDEBUGMSG(c) doPrintf(gimMainPort,NULL,c,0,0,0,0)
  197. #define STDEBUGMSG1(c,p) doPrintf(gimMainPort,NULL,c,p,0,0,0)
  198. #define STDEBUGMSG2(c,p1,p2) doPrintf(gimMainPort,NULL,c,p1,p2,0,0,0)
  199. #define STDEBUGMSG3(c,p1,p2,p3) doPrintf(gimMainPort,NULL,c,p1,p2,p3,0)
  200. #define STDEBUGMSG4(c,p1,p2,p3,p4) doPrintf(gimMainPort,NULL,c,p1,p2,p3,p4)
  201. #endif !OWNDEBUG
  202.  
  203. #else
  204.  
  205. #define DEBUGCMD(c)
  206. #define DEBUGMSG(c)
  207. #define DEBUGMSG1(c,p)
  208. #define DEBUGMSG2(c,p1,p2)
  209. #define DEBUGMSG3(c,p1,p2,p3)
  210. #define DEBUGMSG4(c,p1,p2,p3,p4)
  211.  
  212. #define STDEBUGMSG(c)
  213. #define STDEBUGMSG1(c,p)
  214. #define STDEBUGMSG2(c,p1,p2)
  215. #define STDEBUGMSG3(c,p1,p2,p3)
  216. #define STDEBUGMSG4(c,p1,p2,p3,p4)
  217.  
  218. #endif else !DEBUG
  219.  
  220. #endif !GIMMELIB_DEBUG_H
  221. SHAR_EOF
  222. cat << \SHAR_EOF > gadget.h
  223. #ifndef GIMMELIB_GADGET_H
  224. #define GIMMELIB_GADGET_H
  225.  
  226. #include "gimmelib/postext.h"
  227.  
  228. /***
  229.     flags for gimmeBoolGadget()
  230.     ==> see flags for positionText() in <gimmelib/postext.h>
  231.     NOTE: the default flags are as follows (use the appropriate flags or 0L):
  232.         x : left
  233.         y : top
  234. ***/
  235.  
  236. #ifdef I_AM_GADGET
  237. /* internal spacing for gadgets */
  238. #define HORIZ_SPACE    5
  239. #define VERT_SPACE    2
  240. #define AROUND_SPACE    1
  241. #endif I_AM_GADGET
  242.  
  243. /* size of string gadget's undo buffer */
  244. #define GIM_DFLT_UNDO_BUF_SIZE        81
  245.  
  246. #endif !GIMMELIB_GADGET_H
  247. SHAR_EOF
  248. cat << \SHAR_EOF > gimNOshortdefs.h
  249. #ifndef GIMMELIB_NO_SHORT_DEFS_H
  250. #define GIMMELIB_NO_SHORT_DEFS_H
  251.  
  252. #ifdef GIMMELIB_SHORT_DEFS_H
  253. #undef SCREEN
  254. #undef WINDOW
  255. #undef NEWSCREEN
  256. #undef NEWWINDOW
  257. #undef BITMAP
  258. #undef RASTPORT
  259. #undef TEXTATTR
  260. #undef REQUESTER
  261. #undef GADGET
  262. #undef BORDER
  263. #undef STRINGINFO
  264. #undef PROPINFO
  265. #undef IMSG
  266. #undef ITEXT
  267. #undef IMAGE
  268. #undef MSGPORT
  269. #undef MESSAGE
  270. #undef TASK
  271. #undef RASINFO
  272. #undef TEXTFONT
  273. #undef TIMEVAL
  274. #undef TIMEREQ
  275. #undef CPRLIST
  276. #undef AREAINFO
  277. #undef TMPRAS
  278. #undef IOREQUEST
  279. #undef IOSTDREQ
  280. #undef MENU
  281. #undef MENUITEM
  282. #undef GIMMELIB_SHORT_DEFS_H
  283. #endif GIMMELIB_SHORT_DEFS_H
  284.  
  285. #endif !GIMMELIB_NO_SHORT_DEFS_H
  286. SHAR_EOF
  287. cat << \SHAR_EOF > gimmeall.h
  288. #ifndef GIMMELIB_ALL_H
  289. #define GIMMELIB_ALL_H
  290.  
  291. #include "gimmelib/gimmefuncs.h"
  292. /* #include "gimmelib/gimshortdefs.h" */
  293. /* #include "gimmelib/gimeNOshortdefs.h" */
  294. /* #include "gimmelib/macros.h" */
  295. /* #include "gimmelib/debug.h" */
  296.  
  297. #include "gimmelib/bitplane.h"
  298. #include "gimmelib/color.h"
  299. #include "gimmelib/communic.h"
  300. #include "gimmelib/copystuff.h"
  301. #include "gimmelib/gadget.h"
  302. #include "gimmelib/globals.h"
  303. #include "gimmelib/graph.h"
  304. #include "gimmelib/intuistuff.h"
  305. #include "gimmelib/menustuff.h"
  306. #include "gimmelib/minterm.h"
  307. #include "gimmelib/picture.h"
  308. #include "gimmelib/postext.h"
  309. #include "gimmelib/requester.h"
  310. #include "gimmelib/scrollbar.h"
  311. #include "gimmelib/sound.h"
  312. #include "gimmelib/stdstuff.h"
  313. #include "gimmelib/window.h"
  314.  
  315. #endif !GIMMELIB_ALL_H
  316. SHAR_EOF
  317. cat << \SHAR_EOF > gimmefuncs.h
  318. #ifndef GIMMELIB_FUNCTIONS_H
  319. #define GIMMELIB_FUNCTIONS_H
  320.  
  321. #include <exec/types.h>
  322. #include <intuition/intuition.h>
  323. #include <exec/memory.h>
  324. #ifdef AZTEC_C
  325. #include <functions.h>
  326. #endif AZTEC_C
  327.  
  328. /* short defines for system structs used below */
  329. #include "gimmelib/gimshortdefs.h"
  330.  
  331. /* these ones have custom structs */
  332. #include "gimmelib/sound.h"
  333. #include "gimmelib/picture.h"
  334. #include "gimmelib/graph.h"
  335. #include "gimmelib/communic.h"
  336.  
  337.  
  338. /* bitmap.c */
  339. BITMAP *    gimmeBitMap(/*  SHORT depth, SHORT width, SHORT height  */);
  340. short        getRidOfBitMap(/*  BITMAP*  */);
  341.  
  342. /* bitplane.c (bitplane.h) */
  343. ULONG        gimmeBitPlanes(/*  BITMAP*, ULONG myflags  */);
  344. short        getRidOfBitPlanes(/*  BITMAP*, ULONG myflags  */);
  345.  
  346. /* color.c (color.h) */
  347. USHORT *    getDefaultColors();
  348. short        setColors(/*  SCREEN*, USHORT* ctable, SHORT colors  */);
  349. short        checkColors(/*  SCREEN*, SHORT colors */);
  350.  
  351. /* communic.c (communic.h) */
  352. short        c_init();
  353. short        c_done();
  354. short        c_open(/*  SERPARMS*  */);
  355. short        c_setup(/*  SERPARMS*  */);
  356. short        c_close();
  357. short        c_emptyc();
  358. short        c_getc(/*  char*  */);
  359. short        c_gets(/*  char*, SHORT num  */);
  360. short        c_getline(/*  char*, SHORT num  */);
  361. short        c_setEOL(/*  char  */);
  362. short        c_putc(/*  char  */);
  363. short        c_puts(/*  char*, SHORT num  */);
  364.  
  365. /* copystuff.c (copystuff.h) */
  366. BORDER *    copyBorder(/*  void** memheadptr, BORDER*, SHORT numbord,
  367.                 ULONG myflags  */);
  368. IMAGE *     copyImage(/*  void** memheadptr, IMAGE*, SHORT numimage,
  369.                 ULONG myflags  */);
  370. short        copyDataImage(/*  USHORT* srcdata, IMAGE*  */);
  371. short        copyImageData(/*  IMAGE*, USHORT* destdata  */);
  372. ITEXT *     copyIntuiText(/*  void** memheadptr, ITEXT*, SHORT numitext,
  373.                 ULONG myflags  */);
  374. MENU *        copyMenu(/*  void** memheadptr, MENU*, SHORT nummenu, SHORT numitem,
  375.                 SHORT numsub, ULONG myflags  */);
  376. MENUITEM *  copyMenuItem(/*  void** memheadptr, MENU*, SHORT numitem,
  377.                 SHORT numsub, ULONG myflags  */);
  378.  
  379. /* dbuf.c (minterm.h) */
  380. short        makeDBuf(/*  SCREEN*, BITMAP** bmptr  */);
  381. short        unmakeDBuf(/*  SCREEN*, BITMAP** bmptr, BITMAP*  */);
  382. short        swapDBuf(/*  SCREEN*, SHORT minterm  */);
  383.  
  384. /* dbufquick.c (minterm.h) */
  385. short        makeDBufQuick(/*  SCREEN*, BITMAP** bmptr, CPRLIST** lcpr,
  386.                 CPRLIST** scpr    */);
  387. short        unmakeDBufQuick(/*  SCREEN*, BITMAP** bmptr, BITMAP*,
  388.                 CPRLIST** lcpr, CPRLIST** scpr    */);
  389. short        swapDBufQuick(/*  SCREEN*, SHORT minterm, CPRLIST** lcpr,
  390.                 CPRLIST** scpr    */);
  391.  
  392. /* dbufvquick.c (minterm.h) */
  393. short        makeDBufVQuick(/*  SCREEN*, BITMAP** bmptr  */);
  394. short        unmakeDBufVQuick(/*  SCREEN*, BITMAP** bmptr, BITMAP*  */);
  395. short        swapDBufVQuick(/*  SCREEN*, SHORT minterm  */);
  396.  
  397. /* dualpf.c */
  398. short        makeDualPlayfield(/*  SCREEN*, RASINFO*, SHORT depth  */);
  399. short        unmakeDualPlayfield(/*  SCREEN*  */);
  400.  
  401. /* font.c */
  402. TEXTFONT *  gimmeFont(/*  TEXTATTR*  */);
  403. TEXTFONT *  gimmeFontLazy(/*  UBYTE *name, UWORD size  */);
  404. short        getRidOfFont(/*  TEXTFONT*  */);
  405.  
  406. /* gadget.c (gadget.h) */
  407. GADGET *    gimmeBoolGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
  408.                 SHORT xsize, SHORT ysize, UBYTE* s, UBYTE* s2,
  409.                 TEXTATTR*, ULONG myflags  */);
  410. GADGET *    gimmeBoolImageGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
  411.                 SHORT depth, SHORT width, SHORT height,
  412.                 ULONG myflags, SHORT dep2, SHORT wid2,
  413.                 SHORT ht2  */);
  414. GADGET *    gimmePropGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
  415.                 SHORT xsize, SHORT ysize, UBYTE* label,
  416.                    TEXTATTR*, ULONG activflags, ULONG propflags  */);
  417. PROPINFO *  gimmePropInfo(/*  void** memheadptr, ULONG flags  */);
  418. GADGET *    gimmeStringGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
  419.                 SHORT width, SHORT maxbuf, UBYTE* initstr,
  420.                 UBYTE* label, TEXTATTR*, ULONG activflags  */);
  421. STRINGINFO *gimmeStringInfo(/*  void** memheadptr, SHORT bufsize, UBYTE *s,
  422.                 ULONG flags  */);
  423. short        getRidOfGadgets(/*  GADGET* firstgadget  */);
  424.  
  425. /* gadgstuff.c */
  426. short        clearGadgets(/*  GADGET* firstgadget, WINDOW*, REQUESTER*,
  427.                 SHORT numgad  */);
  428. short        toggleBoolGadget(/*  WINDOW*, GADGET*, REQUESTER*  */);
  429. GADGET *    findGadget(/*  GADGET*, USHORT id  */);
  430. GADGET *    findMyFirstGadget(/*  WINDOW*, USHORT id  */);
  431.  
  432. /* graph.c (graph.h) */
  433. GRAPH *     gimmeGraph(/*  NEWGRAPH*, BITMAP*, AREAINFO*, TMPRAS*  */);
  434. short        getRidOfGraph(/*  GRAPH*  */);
  435. VOID        clearGraph(/*  GRAPH*  */);
  436. VOID        resetGraph(/*  GRAPH*  */);
  437. VOID        drawGraphAxesOnly(/*  GRAPH*  */);
  438. SHORT        drawGraphAxes(/*  GRAPH*  */);
  439. VOID        drawGraphTitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
  440.                 ULONG myflags  */);
  441. VOID        drawGraphXtitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
  442.                 ULONG myflags  */);
  443. VOID        drawGraphYtitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
  444.                 ULONG myflags  */);
  445. SHORT        graphWriteLabel(/*  GRAPH*, ULONG myflags, SHORT first, SHORT last,
  446.                 SHORT step  */);
  447. VOID        addToGraph(/*  GRAPH*, x, y  */);
  448.  
  449. /* inputhand.c */
  450. IOSTDREQ *  addInputHandler(/*  void (*handler)(), APTR data, BYTE pri,
  451.                 UBYTE* name  */);
  452. short        removeInputHandler(/*  IOSTDREQ*  */);
  453.  
  454. /* intuistuff.c */
  455. BORDER *    gimmeBorder(/*  void** memheadptr, SHORT xsize, SHORT ysize  */);
  456. IMAGE *     gimmeImage(/*  void** memheadptr, SHORT depth, SHORT width,
  457.                 SHORT height  */);
  458. ITEXT *     gimmeIntuiText(/*  void** memheadptr, UBYTE *s, TEXTATTR*,
  459.                 SHORT optwidth    */);
  460.  
  461. /* keyboard.c */
  462. SHORT        deadKeyConvert(/*  IMSG, UBYTE* buf, USHORT size, KEYMAP*  */);
  463.  
  464. /* menu.c */
  465. MENU *        gimmeMenu(/*  void** memheadptr, SHORT left, SHORT width,
  466.                 UBYTE* name, ULONG flags  */);
  467. MENUITEM *  gimmeMenuItem(/*  void** memheadptr, SHORT left, SHORT width,
  468.                 SHORT height, BYTE command, UBYTE* name,
  469.                 TEXTATTR* textattr, ULONG flags  */);
  470.  
  471. /* menustuff.c (menustuff.h) */
  472. ULONG        addMenuItem(/*  MENU*, MENUITEM*, SHORT positem, SHORT possub,
  473.                 SHORT numitem, ULONG myflags  */);
  474. MENUITEM *  removeMenuItem(/*  MENU *, MENUITEM*, SHORT positem, SHORT possub,
  475.                 SHORT numitem, ULONG myflags  */);
  476. ULONG        addMenu(/*  MENU** menuptr, MENU*, SHORT posmenu,
  477.                 SHORT nummenu, ULONG myflags  */);
  478. MENU *        removeMenu(/*  MENU** menuptr, MENU*, SHORT posmenu,
  479.                 SHORT nummenu, ULONG myflags  */);
  480. short        adjustMenuLefts(/*  MENU* menu, MENU* stop, SHORT leftedge,
  481.                 ULONG myflags  */);
  482. short        adjustMenuItems(/*  ITEM* item, ITEM* stop, SHORT topedge,
  483.                 SHORT meposition, ULONG myflags  */);
  484.  
  485. /* memchain.c */
  486. void *        chainAllocMem(/*  void** memheadptr, ULONG size, ULONG flags  */);
  487. VOID        chainFreeMem(/*  void* memhead  */);
  488. short        linkChainMem(/*  void** memheadptr, void* memhead  */);
  489. short        pluckChainMem(/*  void** memheadptr, void* memory  */);
  490.  
  491. /* message.c */
  492. MESSAGE *   gimmeMessage(/*  ULONG size, MSGPORT*  */);
  493. short        getRidOfMessage(/*  MESSAGE*  */);
  494.  
  495. /* picture.c (picture.h) */
  496. PICTURE *   gimmePicture(/*  UBYTE* filename, ULONG myflags  */);
  497. short        getRidOfPicture(/*  PICTURE*  */);
  498. short        positionPicture(/*  RASTPORT*, ULONG myflags, PICTURE*,
  499.                 SHORT minterm, SHORT x, SHORT y  */);
  500. short        usePictureColors(/*  PICTURE*, SCREEN*  */);
  501.  
  502. /* postext.c (postext.h) */
  503. SHORT        positionText(/*  RASTPORT*, ULONG myflags, UBYTE* s, LONG num,
  504.                 SHORT x, SHORT y  */);
  505.  
  506. /* requester.c (requester.h) */
  507. SHORT        gimmeAutoRequest(/*  WINDOW*, UBYTE* string, TEXTATTR*  */);
  508. REQUESTER * gimmeRequester(/*  void** memheadptr, SHORT left, SHORT top,
  509.             SHORT width, SHORT height, UBYTE backfill,
  510.             GADGET* gplist, UBYTE *s, TEXTATTR*, ULONG flags  */);
  511.  
  512. /* screen.c */
  513. NEWSCREEN * gimmeNewScreen(/*  ULONG modes, ULONG type, SHORT depth,
  514.                 UBYTE* title, TEXTATTR*  */);
  515. short        getRidOfNewScreen(/*  NEWSCREEN*  */);
  516. SCREEN *    gimmeScreen(/*  NEWWINDOW*, WINDOW** winptr, SHORT depth,
  517.                 ULONG IDCMPflags, ULONG winflags  */);
  518. SCREEN *    gimmeScreenLazy(/*  NEWWINDOW*, WINDOW** winptr, SHORT depth  */);
  519. short        getRidOfScreen(/*  SCREEN*, WINDOW*  */);
  520. short        lowerScreen(/*  SCREEN*, SHORT toheight  */);
  521. short        raiseScreen(/*  SCREEN*, SHORT toheight  */);
  522.  
  523. /* scrollbar.c (scrollbar.h) */
  524. GADGET *    gimmeFullScrollBar(/*  WINDOW*, USHORT id, ULONG propflags,
  525.                 ULONG myflags, USHORT id1, USHORT id2  */);
  526. GADGET *    gimmeScrollBar(/*  WINDOW*, USHORT id, ULONG propflags,
  527.                 ULONG myflags  */);
  528. GADGET *    gimmeOneScroll(/*  WINDOW*, USHORT id, ULONG dirflags,
  529.                 ULONG myflags  */);
  530.  
  531. /* sound.c (sound.h) */
  532. SOUND *     gimmeSound(/*  UBYTE* filename  */);
  533. short        getRidOfSound(/*  SOUND*  */);
  534.  
  535. /* stdstuff.c (stdstuff.h) */
  536. ULONG        gimmeStdStuff(/*  ULONG myflags, SHORT rev  */);
  537. ULONG        getRidOfStdStuff(/*  ULONG myflags  */);
  538.  
  539. /* subtinit.c */
  540. short        initSubTasker(/*  SHORT*, MSGPORT**  */);
  541. short        doneSubTasker(/*  SHORT*, MSGPORT**  */);
  542. SHORT        handleSpecialSubTaskMsg(/*  SHORT*, MSGPORT**  */);
  543. short        doPrintf(/*  MSGPORT* dosport, MSGPORT* replyport, UBYTE* s,
  544.                 LONG p1, LONG p2, double p3, double p4    */);
  545.  
  546. /* subtask.c */
  547. TASK *        gimmeSubTask(/*  SHORT*, MSGPORT**, LONG stacksize, LONG datasize,
  548.                 MSGPORT** myportptr  */);
  549. VOID        undoGimmeSubTask(/*  TASK*  */);
  550. short        startSubTask(/*  TASK*, char* name, BYTE pri,
  551.                 void (*initialpc)(), void (*finalpc)()  */);
  552. VOID        killSubTask(/*  SHORT*, MSGPORT**, TASK*  */);
  553.  
  554. /* timer.c */
  555. TIMEREQ *   accessTimer(/*  ULONG unit, MSGPORT** msgportptr  */);
  556. LONG        releaseTimer(/*  TIMEREQ* master, MSGPORT* saveport  */);
  557. TIMEREQ *   gimmeTimeRequest(/*  TIMEREQ* master  */);
  558. LONG        getRidOfTimeRequest(/*  TIMEREQ* slave  */);
  559.  
  560. /* timerstuff.c */
  561. LONG        timeDelay(/*  ULONG secs, ULONG micros, ULONG unit, TIMEREQ*  */);
  562. TIMEREQ *   timeDelayAsync(/*  ULONG secs, ULONG micros, ULONG unit,
  563.                 TIMEREQ*  */);
  564. LONG        waitTimer(/*  TIMEREQ*  */);
  565. LONG        killTimeDelay(/*  TIMEREQ*  */);
  566. short        getSysTime(/*  ULONG* secsptr, ULONG* microsptr, TIMEREQ*  */);
  567. short        setSysTime(/*  ULONG secs, ULONG micros, TIMEREQ*  */);
  568.  
  569. /* window.c (window.h) */
  570. NEWWINDOW * gimmeNewWindow(/*  UBYTE* title, SCREEN*, SHORT left, SHORT top,
  571.                 ULONG IDCMPflags, ULONG flags  */);
  572. short        getRidOfNewWindow(/*  NEWWINDOW*  */);
  573. WINDOW *    gimmeWindow(/*  NEWWINDOW*, SHORT depth, SHORT width,
  574.                 SHORT height  */);
  575. short        getRidOfWindow(/*  WINDOW*  */);
  576.  
  577. /* undefine the gimshortdefs.h defines to avoid possible redefined symbols */
  578. #include "gimmelib/gimNOshortdefs.h"
  579.  
  580. #endif !GIMMELIB_FUNCTIONS_H
  581. SHAR_EOF
  582. cat << \SHAR_EOF > gimshortdefs.h
  583. #ifndef GIMMELIB_SHORT_DEFS_H
  584. #define GIMMELIB_SHORT_DEFS_H
  585.  
  586. /* some short-form defines
  587.  * (should be typedefs, but then you can't undefine them)
  588. #define SCREEN        struct Screen
  589. #define WINDOW        struct Window
  590. #define NEWSCREEN   struct NewScreen
  591. #define NEWWINDOW   struct NewWindow
  592. #define BITMAP        struct BitMap
  593. #define RASTPORT    struct RastPort
  594. #define TEXTATTR    struct TextAttr
  595. #define REQUESTER   struct Requester
  596. #define GADGET        struct Gadget
  597. #define BORDER        struct Border
  598. #define STRINGINFO  struct StringInfo
  599. #define PROPINFO    struct PropInfo
  600. #define IMSG        struct IntuiMessage
  601. #define ITEXT        struct IntuiText
  602. #define IMAGE        struct Image
  603. #define MSGPORT     struct MsgPort
  604. #define MESSAGE     struct Message
  605. #define TASK        struct Task
  606. #define RASINFO     struct RasInfo
  607. #define TEXTFONT    struct TextFont
  608. #define TIMEVAL     struct timeval
  609. #define TIMEREQ     struct timerequest
  610. #define CPRLIST     struct cprlist
  611. #define AREAINFO    struct AreaInfo
  612. #define TMPRAS        struct TmpRas
  613. #define IOREQUEST   struct IORequest
  614. #define IOSTDREQ    struct IOStdReq
  615. #define MENU        struct Menu
  616. #define MENUITEM    struct MenuItem
  617. #ifdef GIMMELIB_NO_SHORT_DEFS_H
  618. #undef GIMMELIB_NO_SHORT_DEFS_H
  619. #endif GIMMELIB_NO_SHORT_DEFS_H
  620.  
  621. #endif !GIMMELIB_SHORT_DEFS_H
  622. SHAR_EOF
  623. cat << \SHAR_EOF > globals.h
  624. #ifndef GIMMELIB_GIM_GLOBALS_H
  625. #define GIMMELIB_GIM_GLOBALS_H
  626.  
  627. #ifndef I_AM_GIM_GLOBALS
  628. extern struct TextAttr gimMyFont;    /* topaz 80 font */
  629.  
  630. extern UBYTE *gimAutReqPostext;
  631. extern UBYTE *gimAutReqNegtext;
  632.  
  633. extern USHORT gimDataOneScrollUp[];
  634. extern USHORT gimDataOneScrollDown[];
  635. extern USHORT gimDataOneScrollLeft[];
  636. extern USHORT gimDataOneScrollRight[];
  637. #endif !I_AM_GIM_GLOBALS
  638.  
  639. #endif !GIMMELIB_GIM_GLOBALS_H
  640. SHAR_EOF
  641. cat << \SHAR_EOF > graph.h
  642. #ifndef GIMMELIB_GRAPH_H
  643. #define GIMMELIB_GRAPH_H
  644.  
  645. #include "gimmelib/postext.h"
  646.  
  647.  
  648. typedef struct _gim_nax {
  649.     SHORT origin, size;     /* offset of origin and axis size in pixels */
  650.     SHORT low;            /* coord corresponding to origin */
  651.     SHORT amt;            /* modified by newgraph flags */
  652.     SHORT initpt;        /* coord of initial point (see newgraph flags) */
  653.     SHORT step;         /* step size for even labelling, 0 for fancy */
  654.     SHORT labnum, labdenom; /* fraction for label scaling */
  655. } NEWAXIS;
  656.  
  657. typedef struct _gim_axis {
  658.     SHORT origin, size;     /* offset of origin and axis size in pixels */
  659.     SHORT low;            /* coord corresponding to origin */
  660.     SHORT high;         /* coord corresponding to high end of axis */
  661.     SHORT scale;        /* scale of axis: -ve means coords per pixel */
  662.     SHORT usesize;        /* actual size of axis used in pixels */
  663.     SHORT lastdata;        /* last coord added to graph */
  664.     SHORT lastoff;        /* offset of last coord in pixels */
  665.     SHORT step;         /* step size for even labelling, 0 for fancy */
  666.     SHORT labnum, labdenom; /* fraction for label scaling */
  667.     SHORT flow, fhigh;        /* first low and high - for graph reinit */
  668.     SHORT fdata, foff;        /* first coord and offset - for graph reinit */
  669. } AXIS;
  670.  
  671. typedef struct _gim_newgr {
  672.     UBYTE   *title, *xtitle, *ytitle;        /* graph and axes titles */
  673.     struct TextAttr *titleta, *xta, *yta;   /* text attributes for titles */
  674.     BYTE    FPen, BPen, AxesPen, TitlePen;  /* colours for primary parts */
  675.     ULONG   flags, ctlflags;            /* all-important flags */
  676.     NEWAXIS X, Y;                /* actual new-axis structs */
  677.     struct RastPort *rp;            /* RastPort to be copied, or NULL */
  678. } NEWGRAPH;
  679.  
  680.  
  681. /* flags for NEWGRAPH.flags (and GRAPH.flags) */
  682. #define GGR_DELTAX        (1L << 0)
  683. #define GGR_LINETOX        (1L << 1)
  684. #define GGR_FILLTOX        (1L << 2)
  685. #define GGR_BLACKTOX        (1L << 3)
  686. #define GGR_X_MAX        (1L << 8)   /* default */
  687. #define GGR_X_INTERVALS     (1L << 9)
  688. #define GGR_X_SPACING        (1L << 10)  /* auto-spacing based on size */
  689. #define GGR_X_INTEGRAL        (1L << 11)
  690. #define GGR_X_FLAGS        0x0000FFFFL
  691.  
  692. #define GGR_DELTAY        (1L << 16)
  693. #define GGR_LINETOY        (1L << 17)
  694. #define GGR_FILLTOY        (1L << 18)
  695. #define GGR_BLACKTOY        (1L << 19)
  696. #define GGR_Y_MAX        (1L << 24)  /* default */
  697. #define GGR_Y_INTERVALS     (1L << 25)
  698. #define GGR_Y_SPACING        (1L << 26)
  699. #define GGR_Y_INTEGRAL        (1L << 27)
  700. #define GGR_Y_FLAGS        0xFFFF0000L
  701.  
  702. #define GGR_DEFAULT        0L
  703.  
  704. /* control flags for NEWGRAPH.ctlflags (and GRAPH.ctlflags) */
  705. #define GGR_INITORIGIN        (1L << 0)
  706. #define GGR_INITPOINT        (1L << 1)
  707. #define GGR_NOCLEARSTART    (1L << 8)
  708. #define GGR_NOCONNECTLINE   (1L << 9)
  709. #define GGR_NOLABELS        (1L << 10)
  710. #define GGR_CLEARONEND        (1L << 15)
  711. #define GGR_HIRES        (1L << 24)
  712. #define GGR_INTERLACE        (1L << 25)
  713.  
  714. #define GGR_CTL_DEFAULT     0L
  715.  
  716. /* explanation of drawing flags:
  717.  * DELTA:    coord of new point is relative to coord of previous point
  718.  * LINETO:    draw a line from the point to the respective axis
  719.  * FILLTO:    area fill the trapezoid from previous point to resp. axis
  720.  * BLACKTO:    like LINETO but using background colour (useful with FILLTO)
  721.  
  722. /* explanation of newaxis-specific flags:
  723.  * MAX:     newaxis.amt specifies max coord on initial graph
  724.  * INTERVALS:    newaxis.amt specifies difference between low and high coords
  725.  * SPACING:    newaxis.amt specifies the scale to be applied (+ve or -ve)
  726.  * INTEGRAL:    force integer number of pixels/coord or coords/pixel
  727.  
  728. /* explanation of control flags:
  729.  * INITORIGIN:        use origin as initial point
  730.  * INITPOINT:        use point specified in nexaxes as initial point
  731.  *            (otherwise newaxis.initpt is ignored)
  732.  * NOCLEARSTART:    don't clear the rastport when initializing graph
  733.  *            (useful if several graphs on same "rastport")
  734.  * NOLABELS:        don't draw titles, axes and labels for me ever (I'll do it)
  735.  * NOCONNECTLINE:   don't connect points in graph by a line
  736.  * CLEARONEND:        clear the graph when doing getRidOfGraph
  737.  * HIRES:        graph to be displayed on HIRES screen
  738.  * INTERLACE:        graph to be displayed on INTERLACE screen
  739.  *            (these two are useful for determining aspect ratios)
  740.  
  741.  
  742. typedef struct _gim_graph {
  743.     struct RastPort rp;         /* actual RastPort struct */
  744.     ULONG   flags;            /* flags, as in newgraph */
  745.     ULONG   ctlflags;            /* control flags, as in newgraph */
  746.     UBYTE   *title, *xtitle, *ytitle;    /* graph and axes titles */
  747.     struct TextFont *titletf, *xtf, *ytf;   /* fonts for titles */
  748.     struct TextFont *xlabtf, *ylabtf;        /* fonts for axes' labels */
  749.     BYTE    FPen, BPen, AxesPen, TitlePen;  /* colours for primary parts */
  750.     BYTE    XlabPen, YlabPen, XtitlePen, YtitlePen;   /* secondary colours */
  751.     SHORT   points;            /* number of points added so far */
  752.     AXIS    X, Y;            /* actual axis structs */
  753.     void    *memhead;            /* memory-chain for this graph */
  754.     struct _gim_graph *next;         /* link to next graph (future use) */
  755. } GRAPH;
  756.  
  757.  
  758. /* INTERNAL scaling factor used by graph routines for intermediate results */
  759. #define SCALE        6
  760.  
  761.  
  762. /* flags for graphWriteLabel() */
  763. #define GWL_XAXIS    (1L << 20)      /* label the x-axis (don't set yaxis) */
  764. #define GWL_YAXIS    (1L << 21)      /* label the y-axis (don't set xaxis) */
  765. #define GWL_CLEAR_ONLY    (1L << 22)      /* clear the previous labels only! */
  766. #define GWL_CLEAR_OLD    (1L << 23)      /* clear previous then draw labels */
  767. #define GWL_RESERVED    (0x000fffffL)   /* reserved for internal use only!! */
  768. #define GWL_DEFAULT    (AWL_YAXIS)
  769.  
  770.  
  771. #endif !GIMMELIB_GRAPH_H
  772. SHAR_EOF
  773. cat << \SHAR_EOF > intuistuff.h
  774. #ifndef GIMMELIB_INTUISTUFF_H
  775. #define GIMMELIB_INTUISTUFF_H
  776.  
  777. /* note the image size IN BYTES returned by this macro is a ULONG */
  778. #define  GIM_IMAGESIZE(depth, width, height)  \
  779.         ( (ULONG)((width + 15) >> 4) * height * (sizeof(SHORT) * depth) )
  780.  
  781. #endif !GIMMELIB_INTUISTUFF_H
  782. SHAR_EOF
  783. cat << \SHAR_EOF > macros.h
  784. #ifndef GIMMELIB_MACROS_H
  785. #define GIMMELIB_MACROS_H
  786.  
  787. #ifdef GIM_BUILTIN
  788. #ifdef AZTEC_C
  789. #define strcpy    _BUILTIN_strcpy
  790. #define strcmp    _BUILTIN_strcmp
  791. #define strlen    _BUILTIN_strlen
  792. #endif AZTEC_C
  793. #endif GIM_BUILTIN
  794.  
  795.  
  796. /* WSL-type guess-endguess construct (for internal use only) */
  797. #define GUESS        do {
  798. #define QUIF( cond )    if( cond ) break;
  799. #define ENDGUESS    } while( 0 );
  800.  
  801. #endif !GIMMELIB_MACROS_H
  802. SHAR_EOF
  803. cat << \SHAR_EOF > menustuff.h
  804. #ifndef GIMMELIB_MENUSTUFF_H
  805. #define GIMMELIB_MENUSTUFF_H
  806.  
  807. /* flags for various menu routines (mutually exclusive across routines) */
  808.  
  809. /* note: GMI_APPEAREND and GIM_SHUFFLE do not make much sense together */
  810. #define GMI_ADDSUBITEM    (1L << 1)           /* add this item as a subitem */
  811. #define GMI_FIXUP    (1L << 2)           /* modify new item heights */
  812. #define GMI_SHUFFLE    (1L << 3)           /* modify existing item heights */
  813. #define GMI_APPEAREND    (1L << 4)           /* visually appear at end */
  814. #define GMI_FIXUPME    (1L << 5)           /* modify new mutual excludes */
  815. #define GMI_SHUFFLEME    (1L << 6)           /* modify existing mutual exclude */
  816. #define GMI_REMSUBITEM    (1L << 14)          /* remove this item as a subitem */
  817. #define GMI_ADDRONLY    (1L << 15)          /* just find (sub)item address */
  818.  
  819. #define GMI_RESERVED    (0xfff00000L)       /* reserved for internal use */
  820.  
  821. #define GMI_DEFAULT    0L
  822.  
  823. #endif !GIMMELIB_MENUSTUFF_H
  824. SHAR_EOF
  825. cat << \SHAR_EOF > minterm.h
  826. #ifndef GIMMELIB_MINTERM_H
  827. #define GIMMELIB_MINTERM_H
  828.  
  829. #define GIM_MINTERM_COPY    0x0c0    /* copy source; ignore dest */
  830. #define GIM_MINTERM_DEST    0x0a0    /* keep dest as is */
  831. #define GIM_MINTERM_CLEAR    0x000    /* clear dest block */
  832. #define GIM_MINTERM_FILL    0x0f0    /* fill dest block */
  833. #define GIM_MINTERM_OR        0x0e0    /* mix source and dest */
  834. #define GIM_MINTERM_MIX     GIM_MINTERM_OR
  835. #define GIM_MINTERM_UNMIX    0x020    /* remove source pattern from dest */
  836. #define GIM_MINTERM_XOR     0x060    /* xor source and dest */
  837. #define GIM_MINTERM_INV_SRC    0x030    /* invert source */
  838. #define GIM_MINTERM_INV_DEST    0x030    /* invert dest */
  839.  
  840. /*  4 important bits in minterm are as follows:
  841.  *    7  6  5  4
  842.  *    |  |  |  -> ~src & ~dest
  843.  *    |  |  ----> ~src &  dest
  844.  *    |  ------->  src & ~dest
  845.  *    ---------->  src &  dest
  846. */
  847.  
  848. #endif !GIMMELIB_MINTERM_H
  849. SHAR_EOF
  850. cat << \SHAR_EOF > picture.h
  851. #ifndef GIMMELIB_PICTURE_H
  852. #define GIMMELIB_PICTURE_H
  853.  
  854. #include "gimmelib/bitplane.h"
  855.  
  856. #ifdef I_AM_PICTURE
  857. #define Mk(a,b,c,d)     (((ULONG)(a)<<24) | ((ULONG)(b)<<16) \
  858.                 | ((ULONG)(c)<<8) | (ULONG)(d))
  859. #define EVEN(p)         ((p+1) & ~1)
  860.  
  861. #define ID_FORM     Mk('F', 'O', 'R', 'M')
  862. #define ID_ILBM     Mk('I', 'L', 'B', 'M')
  863. #define ID_BMHD     Mk('B', 'M', 'H', 'D')
  864. #define ID_CMAP     Mk('C', 'M', 'A', 'P')
  865. #define ID_DEST     Mk('D', 'E', 'S', 'T')
  866. #define ID_SPRT     Mk('S', 'P', 'R', 'T')
  867. #define ID_CAMG     Mk('C', 'A', 'M', 'G')
  868. #define ID_CRNG     Mk('C', 'R', 'N', 'G')
  869. #define ID_CCRT     Mk('C', 'C', 'R', 'T')
  870. #define ID_BODY     Mk('B', 'O', 'D', 'Y')
  871. #endif I_AM_PICTURE
  872.  
  873.  
  874. typedef UBYTE Masking;
  875.  
  876. #define mskNone     0
  877. #define mskHasMask    1
  878. #define mskHasTranCol    2
  879. #define mskLasso    3
  880.  
  881. typedef UBYTE Compression;
  882.  
  883. #define cmpNone     0
  884. #define cmpByteRun1    1
  885.  
  886. typedef struct _gim_bmh {
  887.     UWORD    w,h;            /* raster width, height */
  888.     WORD    x,y;            /* pixel position for this image */
  889.     UBYTE    nPlanes;        /* number of bit planes */
  890.     Masking masking;
  891.     Compression compression;
  892.     UBYTE    pad1;            /* unused */
  893.     UWORD    transparentColour;    /* transparent colour number */
  894.     UBYTE    xAspect, yAspect;    /* pixel aspect, a ratio width:height */
  895.     WORD    pageWidth, pageHeight;    /* source page size in pixels */
  896. } BitMapHeader;
  897.  
  898. typedef struct {
  899.     UBYTE red,green,blue;
  900. } ColourRegister;
  901.  
  902. typedef struct {
  903.     ColourRegister *luts;        /* pointer to look up table */
  904.     WORD numLuts;            /* number of luts entries */
  905. } LutTable;
  906.  
  907. typedef struct {
  908.     WORD x,y;            /* relative coordinates */
  909. } Point2D;
  910.  
  911. typedef struct {
  912.     UBYTE depth;            /* # of bitplanes in original source */
  913.     UBYTE pad1;            /* unused... put zero here */
  914.     UWORD planePick;        /* how to scatter src into dest */
  915.     UWORD planeOnOff;        /* default bitplane data for above */
  916.     UWORD planeMask;        /* which bitplanes to store into */
  917. } DestMerge;
  918.  
  919. typedef UWORD SpritePrecedence;     /* relative precedence, 0 is highest */
  920.  
  921.  
  922. typedef struct _gim_pic {
  923.     BitMapHeader    bmh;    /* info for this bitmap */
  924.     SHORT        xsize;    /* actual width in pixels */
  925.     void        *memhead;    /* memory-chain allocated for this picture */
  926.     struct BitMap   *bm;    /* pointer to bitmap struct */
  927.     struct ColorMap colormap;    /* actual instance; .ColorTable -> colours */
  928.     ULONG        myflags;    /* flags about the bitmap */
  929.     struct _gim_pic *next;    /* next picture (for future use) */
  930. } PICTURE;
  931.  
  932.  
  933. /***
  934.     flags for gimmePicture()
  935.     ==> see flags for gimmeBitPlanes() in <gimmelib/bitplane.h>
  936. ***/
  937.  
  938. #endif !GIMMELIB_PICTURE_H
  939. SHAR_EOF
  940. cat << \SHAR_EOF > postext.h
  941. #ifndef GIMMELIB_POSTEXT_H
  942. #define GIMMELIB_POSTEXT_H
  943.  
  944.  
  945. /*  Flags to be used in the "myflags" parameter to the
  946.  *  positionText() routine, and perhaps other routines.
  947.  *  Choose only one x-flag and only one y-flag and or them together.
  948. #define GPT_XLEFT    (1L << 0)       /* default for positionText() */
  949. #define GPT_XRIGHT    (1L << 1)
  950. #define GPT_XCENTRE    (1L << 2)
  951. #define GPT_XFLAGS    (0x000000FFL)
  952.  
  953. #define GPT_YTOP    (1L << 8)
  954. #define GPT_YBOTTOM    (1L << 9)
  955. #define GPT_YCENTRE    (1L << 10)
  956. #define GPT_YCENTREBASE (1L << 11)
  957. #define GPT_YBASELINE    (1L << 12)      /* default for positionText() */
  958. #define GPT_YFLAGS    (0x0000FF00L)
  959.  
  960. /* alternatively you can use the following for defaults */
  961. #define GPT_XDEFAULT    0L
  962. #define GPT_YDEFAULT    0L
  963. #define GPT_DEFAULT    0L        /* easy way to get default x,y pos */
  964.  
  965. /* special control flags for positionText() */
  966. #define GPT_YUPWARDS    (1L << 16)
  967. #define GPT_YDOWNWARDS    (1L << 17)
  968. #define GPT_XTHICKEN    (1L << 18)
  969.  
  970. /* special control flags for gimmeBoolGadget() */
  971. #define GPT_FULLWIDTH    (1L << 28)
  972.  
  973. #define GPT_CTLFLAGS    (0x0FFFF0000L)
  974.  
  975. #endif !GIMMELIB_POSTEXT_H
  976. SHAR_EOF
  977. cat << \SHAR_EOF > requester.h
  978. #ifndef GIMMELIB_REQUESTER_H
  979. #define GIMMELIB_REQUESTER_H
  980.  
  981. #ifdef I_AM_REQUESTER
  982. #define GAR_DUMMY_TEXT        "WHY AM I HERE?"
  983.  
  984. #define GAR_BORDER_WIDTH    4        /* number of chars for border width */
  985. #define GAR_HEIGHT        6        /* number of char lines */
  986. #endif I_AM_REQUESTER
  987.  
  988.  
  989. /* original positive and negative text for gimmeAutoRequest() */
  990. #define GAR_POSTEXT    "YES"
  991. #define GAR_NEGTEXT    "NO"
  992.  
  993.  
  994. #ifndef I_AM_GIM_GLOBALS
  995. extern UBYTE *gimAutReqPostext;
  996. extern UBYTE *gimAutReqNegtext;
  997. #endif !I_AM_GIM_GLOBALS
  998.  
  999. #endif !GIMMELIB_REQUESTER_H
  1000. SHAR_EOF
  1001. cat << \SHAR_EOF > scrollbar.h
  1002. #ifndef GIMMELIB_SCROLLBAR_H
  1003. #define GIMMELIB_SCROLLBAR_H
  1004.  
  1005. /* flags for gimmeOneScroll() */
  1006. #define GOS_TOP         (1L << 0)
  1007. #define GOS_BOT         (1L << 1)   /* default if FREEVERT */
  1008. #define GOS_LEFT        (1L << 2)
  1009. #define GOS_RIGHT        (1L << 3)   /* default if FREEHORIZ */
  1010.  
  1011. /* dimensions of image data for one-scroll gadgets */
  1012. #define GOS_BITWIDTH    16
  1013. #define GOS_BITHEIGHT    9
  1014. #define GOS_BITDEPTH    1
  1015.  
  1016. /* dimensions of Intuition sizing gadget */
  1017. #define GIM_SZWIDTH        16
  1018. #define GIM_SZHEIGHT        9
  1019. #define GIM_SZDEPTH        1
  1020. #define GIM_DFLT_TBHEIGHT   10        /* default Intuition titlebar height */
  1021.  
  1022.  
  1023. #ifndef I_AM_GIM_GLOBALS
  1024. extern USHORT gimDataOneScrollUp[];
  1025. extern USHORT gimDataOneScrollDown[];
  1026. extern USHORT gimDataOneScrollLeft[];
  1027. extern USHORT gimDataOneScrollRight[];
  1028. #endif !I_AM_GIM_GLOBALS
  1029.  
  1030.  
  1031. /* flags for gimmeScrollBar(), gimmeFullScrollBar() */
  1032. #define GSB_DEFAULT        (0L)
  1033. #define GSB_ONE_SCROLL        (1L << 0)   /* gimmescrollbar with one-scrolls */
  1034. #define GSB_NO_TITLEBAR     (1L << 1)
  1035.  
  1036. #endif !GIMMELIB_SCROLLBAR_H
  1037. SHAR_EOF
  1038. cat << \SHAR_EOF > sound.h
  1039. #ifndef GIMMELIB_SOUND_H
  1040. #define GIMMELIB_SOUND_H
  1041.  
  1042. #ifdef I_AM_SOUND
  1043. #define Mk(a,b,c,d)     (((ULONG)(a)<<24) | ((ULONG)(b)<<16) \
  1044.                 | ((ULONG)(c)<<8) | (ULONG)(d))
  1045. #define EVEN(p)         ((p+1) & ~1)
  1046.  
  1047. #define ID_FORM     Mk('F', 'O', 'R', 'M')
  1048. #define ID_8SVX     Mk('8', 'S', 'V', 'X')
  1049. #define ID_VHDR     Mk('V', 'H', 'D', 'R')
  1050. #define ID_NAME     Mk('N', 'A', 'M', 'E')
  1051. #define ID_COPY     Mk('(', 'c', ')', ' ')
  1052. #define ID_AUTH     Mk('A', 'U', 'T', 'H')
  1053. #define ID_ANNO     Mk('A', 'N', 'N', 'O')
  1054. #define ID_ATAK     Mk('A', 'T', 'A', 'K')
  1055. #define ID_RLSE     Mk('R', 'L', 'S', 'E')
  1056. #define ID_BODY     Mk('B', 'O', 'D', 'Y')
  1057. #endif I_AM_SOUND
  1058.  
  1059.  
  1060. typedef LONG Fixed;        /* fixed point value 16bits.16bits */
  1061.  
  1062. #define Unity 0x10000L        /* Unity = Fixed 1.0 = maximum volume */
  1063.  
  1064. #define sCmpNone    0   /* not compressed */
  1065. #define sCmpFibDelta    1   /* Fibonacci delta encoding */
  1066.  
  1067. typedef struct _gim_v8h {
  1068.     ULONG oneShotHiSamples; /* # samples in the high octave 1-shot part */
  1069.     LONG repeatHiSamples;   /* # samples in the high octave repeat part */
  1070.     LONG samplesPerHiCycle; /* # samples/cycle in high octave, else 0 */
  1071.     UWORD samplesPerSec;    /* data sampling rate */
  1072.     UBYTE ctOctave;        /* # octaves of waveform */
  1073.     UBYTE sCompression;     /* data compression technique used */
  1074.     Fixed volume;        /* playback volume from 0 to Unity */
  1075. } Voice8Header;
  1076.  
  1077. typedef struct {
  1078.     UWORD duration;        /* segment duration in milliseconds, >0 */
  1079.     Fixed dest;         /* destination volume factor */
  1080. } EGPoint;
  1081.  
  1082.  
  1083. typedef struct _gim_snd {
  1084.     Voice8Header    vh;     /* info for this sound */
  1085.     BYTE        *body;    /* pointer to body data */
  1086.     LONG        bodylen;    /* actual body length from IFF file */
  1087.     void        *memhead;    /* memory-chain allocated for this sound */
  1088.     struct _gim_snd *next;    /* next sound (for future use) */
  1089. } SOUND;
  1090.  
  1091. #endif !GIMMELIB_SOUND_H
  1092. SHAR_EOF
  1093. cat << \SHAR_EOF > stdstuff.h
  1094. #ifndef GIMMELIB_STDSTUFF_H
  1095. #define GIMMELIB_STDSTUFF_H
  1096.  
  1097. #ifndef I_AM_STDSTUFF
  1098. extern struct IntuitionBase *IntuitionBase;
  1099. extern struct GfxBase        *GfxBase;
  1100. extern struct DiskfontBase  *DiskfontBase;
  1101. extern struct Device        *TimerBase;
  1102.  
  1103. extern struct MsgPort        *gimTimerPort;
  1104. extern struct timerequest   *gimMasterTR;
  1105. extern struct timerequest   *gimSlaveTR;
  1106.  
  1107. extern struct MsgPort        *gimMainPort;
  1108. extern SHORT            gimSubTasks;
  1109.  
  1110. extern void            *gimChainMem;
  1111. #endif !I_AM_STDSTUFF
  1112.  
  1113.  
  1114. /* handy revision number for gimmeStdStuff() */
  1115. #define GSS_REVISION        33
  1116.  
  1117. /* flags for gimmeStdStuff() */
  1118. #define GSS_INTUITION        (1L << 0)       /* IntuitionBase */
  1119. #define GSS_GFX         (1L << 1)       /* GfxBase */
  1120. #define GSS_DISKFONT        (1L << 2)       /* DiskfontBase */
  1121. #define GSS_TIMER        (1L << 3)       /* timer.device and TimerBase */
  1122. #define GSS_SUBTASK        (1L << 4)       /* gimme.lib subtask mechanism */
  1123. #define GSS_MEMCHAIN        (1L << 15)      /* memory chain */
  1124.  
  1125. #define GSS_OPENALL        (0x000fffffL)   /* open positive things */
  1126.  
  1127. /* special bits for gimmeStdStuff() */
  1128. #define GSS_DISABLEABORT    (1L << 20)      /* disable ^C */
  1129. #define GSS_CLOSEWBENCH     (1L << 21)      /* try to close workbench screen */
  1130.  
  1131.  
  1132. /* control flags for getRidOfStdStuff() */
  1133. #define GSS_RUTHLESS        (1L << 25)      /* ignore errors when closing */
  1134. #define GSS_ENABLEABORT     (1L << 30)      /* enable ^C */
  1135. #define GSS_OPENWBENCH        (1L << 29)      /* try to open workbench screen */
  1136.  
  1137. #define GSS_CLOSEALL        (GSS_OPENALL)   /* try closing all; stop on error */
  1138. #define GSS_KILLALL        (GSS_CLOSEALL | GSS_RUTHLESS)
  1139.  
  1140.  
  1141. #endif !GIMMELIB_STDSTUFF_H
  1142.  
  1143. SHAR_EOF
  1144. cat << \SHAR_EOF > window.h
  1145. #ifndef GIMMELIB_WINDOW_H
  1146. #define GIMMELIB_WINDOW_H
  1147.  
  1148. #ifdef I_AM_WINDOW
  1149. #define GNW_DETAIL_PEN        -1        /* use default */
  1150. #define GNW_BLOCK_PEN        -1        /* use default */
  1151. #define GNW_MIN_WIDTH        30
  1152. #define GNW_MIN_HEIGHT        20
  1153. #endif I_AM_WINDOW
  1154.  
  1155.  
  1156. /* these IDCMP flags can be or'd into the window types below */
  1157. #define IDCMP_SYS_GADG    (CLOSEWINDOW | NEWSIZE)
  1158. #define IDCMP_MOUSE    (MOUSEMOVE)
  1159. #define IDCMP_GADGETS    (GADGETUP | GADGETDOWN)
  1160.  
  1161. /* mutually exclusive types of window IDCMP */
  1162. #define IDCMP_SIMPLE    (IDCMP_SYS_GADG | ACTIVEWINDOW | REFRESHWINDOW)
  1163. #define IDCMP_SMART    (IDCMP_SIMPLE)
  1164. #define IDCMP_VSMART    ((IDCMP_SMART & ~REFRESHWINDOW))
  1165. #define IDCMP_MENUWIN    (IDCMP_VSMART | MENUPICK)
  1166.  
  1167.  
  1168. /* these flags can be or'd into the window types below */
  1169. #define FLAGS_SYS_GADG    (WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | WINDOWSIZING)
  1170. #define FLAGS_MOUSE    (REPORTMOUSE)
  1171. #define FLAGS_GADGETS    (SIZEBRIGHT | SIZEBBOTTOM)
  1172.  
  1173. /* mutually exclusive types of window flags */
  1174. #define FLAGS_SIMPLE    (FLAGS_SYS_GADG | SIMPLE_REFRESH | RMBTRAP)
  1175. #define FLAGS_SMART    ((FLAGS_SIMPLE & ~REFRESHBITS) | SMART_REFRESH)
  1176. #define FLAGS_VSMART    (FLAGS_SMART | NOCAREREFRESH)
  1177. #define FLAGS_MENUWIN    ((FLAGS_VSMART & ~RMBTRAP))
  1178.  
  1179.  
  1180. /* defaults use by some gimme Window/Screen routines */
  1181. #define IDCMP_DEFAULT    ((IDCMP_MENUWIN & ~NEWSIZE) | MENUPICK)
  1182. #define FLAGS_DEFAULT    ((FLAGS_MENUWIN & ~FLAGS_SYS_GADG) | WINDOWCLOSE \
  1183.                 | BACKDROP | BORDERLESS | ACTIVATE)
  1184.  
  1185. #endif !GIMMELIB_WINDOW_H
  1186. SHAR_EOF
  1187. #    End of shell archive
  1188. exit 0
  1189. -- 
  1190. Bob Page, U of Lowell CS Dept.  page@swan.ulowell.edu  ulowell!page
  1191. Have five nice days.
  1192.